<template>
  <div class="content">
    <hand-nav :erjiIN="erjiIN" :erjiShow="erjiShow"/>
    <PostNav />
    <TanlentsCompon :TanlentsComponData="TanlentsData"/>
    <div class="btn" @click="more">
      <button>点击查看更多</button>
    </div>
  </div>
</template>

<script>
import TanlentsCompon from "../../components/TanlentsCompon";
import PostNav from "./PostNav";
import api from '../../api'
export default {
  components: {
    PostNav,
    TanlentsCompon,
  },
  data(){
      return{
          TanlentsData:[],
          //定义在每个页面购物车 耳机 是否显示
          erjiIN:"erji_A",
          erjiShow:true,
      }
  },
  methods:{
    http(){
      api.getTalents().then(res=>{
          // console.log(res.data.list);
          if(this.TanlentsData == []){
            this.TanlentsData=res.data.list
          }else{
            this.TanlentsData=[...this.TanlentsData,...res.data.list]
          }
          
      })
    },
    more(){
      this.http()
    }
  },
  mounted(){
      this.http()
  }
};
</script>

<style lang="less" scoped>
.btn{
  width: 100%;
  height: 127px;
  padding: 0 5px 85px;
  box-sizing: border-box;
  
  button{
    width: 100%;
    height: 100%;
    border-radius: 8px;
    font-size: 14px;
    background-color: purple;
    color: #fff;
  }
}
</style>